Ravi Vishwakarma is a dedicated Software Developer with a passion for crafting efficient and innovative solutions. With a keen eye for detail and years of experience, he excels in developing robust software systems that meet client needs. His expertise spans across multiple programming languages and technologies, making him a valuable asset in any software development project.
ICSM
12-Oct-2025Example of JSON:
JSON in Python
Python provides a built-in module called
jsonto work with JSON data.You can use it to:
1. Convert Python object to JSON string
Use
json.dumps()Output:
2. Convert JSON string to Python object
Use
json.loads()Output:
3. Read/Write JSON file
Write to file:
Read from file:
Supported Data Types
Extra Tip – Pretty Print JSON
You can make JSON output more readable using
indent:Output: